import React from 'react'

export default function ComB(props) {
    const { stateB, setStateA, setStateB} = props
    const onButtonClick = () => {
        setStateA(stateB)
    }
    const onResetButtonClick = () => {
        setStateA("B")
    }
  return (
    <div>
      {stateB}
        <button onClick={onButtonClick}>把A变成B</button>
        <button onClick={onResetButtonClick}>还原B</button>
    </div>
  )
}
